package us.icitap.commandcenter.ui.dispatcher;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;

import org.vaadin.artur.icepush.ICEPush;

import us.icitap.commandcenter.business.ejb.persistence.Call;
import us.icitap.commandcenter.ui.custom.CustColumnGenerator;
import us.icitap.commandcenter.ui.custom.CustTable;
import us.icitap.commandcenter.ui.shared.CallTable;
import us.icitap.commandcenter.utils.HandleNotification;

import com.vaadin.data.util.BeanItemContainer;


public class NewCallTable extends CallTable {
	
	
	
	final BeanItemContainer<Call> beans = new BeanItemContainer<Call>(Call.class);
	
	public NewCallTable(boolean oneDispatcher) {
		
		super("Totali i telefonatave me status TELEFONATE E RE: ");
		this.addGeneratedColumn("relatedCallNr", CustColumnGenerator.relatedCallNumberColumnGenerator);
		
		if(!oneDispatcher){
			this.setVisibleColumns(new Object[]{"relatedCallNr","caller", "address", "description", "callReason", "mainDispatcher", "recordDate", "recordUser" });
			this.setColumnHeaders(new String[]{"NR I TEL","TELEFONUESI", "ADRESA", "PERSHKRIMI", "ARSYEJA E TELEFONATES", "ZONA MBULIMIT", "DT. REGJ.", "OPERATORI"});
			this.addGeneratedColumn("mainDispatcher", CustColumnGenerator.dispatcherColumnGenerator);
		}
		else{
			this.setVisibleColumns(new Object[]{"relatedCallNr","caller", "address", "description", "callReason", "recordDate", "recordUser"});
			this.setColumnHeaders(new String[]{"NR I TEL","TELEFONUESI", "ADRESA", "PERSHKRIMI", "ARSYEJA E TELEFONATES", "DT. REGJ.", "OPERATORI"});
		}
		this.addGeneratedColumn("caller", CustColumnGenerator.callerColumnGenerator);
		this.addGeneratedColumn("callReason", CustColumnGenerator.callReasonColumnGenerator);

		this.setPageLength(4);
		this.setWidth("960px");
		this.setColumnWidth("relatedCallNr", 30);
		this.setColumnWidth("caller", 100);
		this.setColumnWidth("callReason", 100);
		this.setColumnWidth("address", 200);
		this.setColumnWidth("description", 200);
		this.setImmediate(true);
		
		this.setSelectable(true);
		
		
		this.addStyleName("red");
	}
	

}
